package com.example.myapplication.adapter;

import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;
import androidx.viewpager2.adapter.FragmentStateAdapter;

import com.example.myapplication.base.BaseFragment;

import java.util.List;

@SuppressWarnings("ALL")
public class FragmentAdapter extends FragmentStateAdapter {

    private List<Fragment> fragmentList = null;

    public FragmentAdapter(@NonNull FragmentActivity fragmentActivity, List<Fragment> fragmentList) {
        super(fragmentActivity);
        this.fragmentList = fragmentList;
    }

    @NonNull
    @Override
    public Fragment createFragment(int position) {

        return fragmentList.get(position);

    }

    @Override
    public int getItemCount() {

        return fragmentList.size();

    }

}